<template>
  <div>
    <!-- 侧边栏 -->
    <el-menu
      class="el-menu-boss-demo"
      background-color="#333744"
      text-color="#fff"
      active-text-color="#409eff"
      :router="true"
      :default-active="activePath"
    >
      <h3 style="color:#fff">&nbsp;&nbsp;Easy-Shop</h3>
      <!-- 一级菜单  -->
      <el-menu-item index="/cash1" @click="saveNavState('/cash1')">
        <i class="el-icon-shopping-cart-1"></i>
        <span slot="title">收银</span>
      </el-menu-item>
      <el-menu-item index="/refundcash1" @click="saveNavState('/refundcash1')">
        <i class="el-icon-s-release"></i>
        <span slot="title">退货</span>
      </el-menu-item>
      <el-menu-item index="/stock1" @click="saveNavState('/stock1')">
        <i class="el-icon-s-shop"></i>
        <span slot="title">库存</span>
      </el-menu-item>
      <el-menu-item index="/personalmgt1" @click="saveNavState('/personalmgt1')">
        <i class="el-icon-setting"></i>
        <span slot="title">个人中心</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  name: 'CashierAside',
  data(){
    return{
      //被激活的链接地址
      activePath:'/'
    }
  },
  methods:{
    //保存链接的激活
    saveNavState(activePath){
      window.sessionStorage.setItem('activePath',activePath)
      this.activePath=window.sessionStorage.getItem('activePath')
    }
  }
}
</script>

<style scoped>
.el-menu-boss-demo:not(.el-menu--collapse) {
  width: 230px;
  height: 730px;

}
h3 {
  color: #ffffff;
  text-align: center;
  line-height: 48px;
}
</style>
